<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@include file="/pages/common/taglibs.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
<title>广东工业大学招生办</title>
<link rel="stylesheet" type="text/css" href="${ctx }/css/login.css" />
<link rel="stylesheet" type="text/css" href="${ctx }/css/reset.css" />
<link rel="stylesheet" type="text/css" href="${ctx }/css/common.css" />
<link rel="stylesheet" type="text/css" href="${ctx }/css/system.css" />
<script type="text/javascript" src="${ctx }/js/jquery.min.js"></script>
 
<script type="text/javascript">
function checkMessage(){
	var name = $("#userName").attr("value"),
		mobile = $("#userMobile").attr("value"),
		pwd1 = $("#userPassword1").attr("value"),
		pwd2 = $("#userPassword2").attr("value"),
		unit = $("#unit").attr("value");
		
	if(name.length<2 || name.length >20){
		$(".validateTips").html("姓名长度要求在 2 与 20 之间");
	}else if(mobile.length != 11){
		$(".validateTips").html("手机号长度不对");
	}else if(pwd1.length<6 || pwd1.length >20){
		$(".validateTips").html("密码长度要求在 6 与 20 之间");
	}else if(pwd1 != pwd2){
		$(".validateTips").html("两次输入的密码必须相同");
	}else if(unit.length == 0){
		$(".validateTips").html("集体缴费单位不能为空");
	}else{
		$(".validateTips").html("");
		//$("#groupRegister").submit();
		$.post("${ctx }/base/group-register!save.action", {mobile:mobile,password:pwd1,name:name,unit:unit}, function(text){
			//$("#msg").val(text);
			if(text == "success"){
				alert("注册成功");
			}
			else if(text == "existed"){
				alert("该手机号已经注册");
			}
			else{
				alert("注册失败，请联系管理员");
			}
			//$("#msg").val(text);
		});
		
	}
}

</script>

</head>

<body onload="document.forms.groupRegister.userName.focus()">
<div class="container">
  <div class="page">
    <div class="header"></div>
    <div class="main">
      <div class="login_frame">
        <div class="login_title">
          <h4>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;集体缴费帐号注册</h4>
        </div>
		
       <div class="login_main">
         <div class="reg">
         <div class="validateTips tc mt20"></div>
         <form name="groupRegister" id="groupRegister" action="${ctx }/base/group-register!save.action" method="post">
            <div class="reg_txt"><div class="label">负责人姓名：</div><input type="text" name="register.Name" id="userName" /></div>
            <div class="reg_txt"><div class="label">手机号：</div><input type="text" name="register.mobile" id="userMobile"/></div>
            <div class="reg_txt"><div class="label">密码：</div><input type="password" name="register.password" id="userPassword1"/></div>
            <div class="reg_txt"><div class="label">确认密码：</div><input type="password"  name="" id="userPassword2"/></div>
            <div class="reg_txt"><div class="label">集体缴费单位：</div><input type="text" name="register.unit" id="unit"/></div>
            <div class="eg_txt">例如：广东工业大学</div>
            <!-- <div class="reg_verify"><div class="label">验证码：</div><input type="text" /></div> -->
            <input type="button" onclick="checkMessage()" class="reg_but2"/>
          </form>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
</body>
</html>
